<ul class="list">
    <?php foreach ($tree as $item): ?>
        <li>
            <div class="item">
                <span class="name">
                    <input type="text" value="<?= $item['name'] ?>" name="class[name]" data-type="name" data-id="<?= $item['id'] ?>" class="input" />
                    <a href="javascript:void(0);" onclick="create(<?= $item['id'] ?>);">新增子分类</a>
                </span>
                
                <span class="option"><a  href="javascript:void(0);" onclick="del(<?= $item['id'] ?>);">删除</a></span>
                <span class="sort"><input type="text" value="<?= $item['sort'] ?>" name="class[sort]" size="4" data-type="sort" data-id="<?= $item['id'] ?>" class="input" /></span>
            </div>
        </li>
        
        <?php if (!empty($item['child'])): ?>
        <li class="sub">
            <?=
            $this->render('_sub', [
                'tree' => $item['child'],
                'is_first'=>$is_first,
            ])
            ?>
        </li>
        <?php endif; ?>
    <?php endforeach; ?>
</ul>

<?php if($is_first!=1):?>
<script>
    $(".input").unbind();
    input_onchange();
</script>
<?php endif;?>